/**
 * @Author:莫维春
 * @Date:2022/3/22
 * 文档说明：封装接口
 * 
 */
import axios from 'axios' 
const $http = axios.create({
    timeout:5000,
    headers:{
        "Content.Type":"application/json;charset=utf-8"
    }
});
//----请求发送前拦截-------
$http.interceptors.request.use(config => {
    config.headers = config.headers || {};
    //config.headers.token = 123;
    return config ;
});
//----请求接收前拦截--------
$http.interceptors.response.use(res => {
    console.log(res);
    //const code:number = res.data?.code ;

    return res.data ;
},err=>{
    console.log(err)
});


export default $http ;